package com.designpatterns.command.test;

import com.designpatterns.command.command.ceiling.CeilingFanOffCommand;
import com.designpatterns.command.command.ceiling.CeilingFanOnCommand;
import com.designpatterns.command.command.garagedoor.GarageDoorDownCommand;
import com.designpatterns.command.command.garagedoor.GarageDoorOpenCommand;
import com.designpatterns.command.command.light.LightOffCommand;
import com.designpatterns.command.command.light.LightOnCommand;
import com.designpatterns.command.command.stereo.StereoOffWithCDCommand;
import com.designpatterns.command.command.stereo.StereoOnWithCDCommand;
import com.designpatterns.command.control.RemoteControl;
import com.designpatterns.command.entity.CeilingFan;
import com.designpatterns.command.entity.GarageDoor;
import com.designpatterns.command.entity.Light;
import com.designpatterns.command.entity.Stereo;

/**
 * @author Brook
 */
public class RemoteLoader {
    public static void main(String[] args) {
        RemoteControl remoteControl = new RemoteControl();
        Light livingRoomLight = new Light("Living Room");
        Light kitchenLight = new Light("Kitchen");
        CeilingFan ceilingFan = new CeilingFan("Living Room");
        GarageDoor garageDoor = new GarageDoor("");
        Stereo stereo = new Stereo("Living Room");

        LightOnCommand livingRoomLightOn = new LightOnCommand(livingRoomLight);
        LightOffCommand livingRoomLightOff = new LightOffCommand(livingRoomLight);
        LightOnCommand kitchenLightOn = new LightOnCommand(kitchenLight);
        LightOffCommand kitchenLightOff = new LightOffCommand(kitchenLight);

        CeilingFanOnCommand ceilingFanOn = new CeilingFanOnCommand(ceilingFan);
        CeilingFanOffCommand ceilingFanOff = new CeilingFanOffCommand(ceilingFan);

        GarageDoorOpenCommand garageDoorOpen = new GarageDoorOpenCommand(garageDoor);
        GarageDoorDownCommand garageDoorDown = new GarageDoorDownCommand(garageDoor);

        StereoOnWithCDCommand stereoOnWithCD = new StereoOnWithCDCommand(stereo);
        StereoOffWithCDCommand stereoOffWithCD = new StereoOffWithCDCommand(stereo);

        remoteControl.setCommand(0, livingRoomLightOn, livingRoomLightOff);
        remoteControl.setCommand(1, kitchenLightOn, kitchenLightOff);
        remoteControl.setCommand(2, ceilingFanOn, ceilingFanOff);
        remoteControl.setCommand(3, stereoOnWithCD, stereoOffWithCD);
        remoteControl.setCommand(4, garageDoorOpen,garageDoorDown);

        remoteControl.onButtonWasPushed(0);
        remoteControl.offButtonWasPushed(0);
        remoteControl.onButtonWasPushed(1);
        remoteControl.offButtonWasPushed(1);
        remoteControl.onButtonWasPushed(2);
        remoteControl.offButtonWasPushed(2);
        remoteControl.onButtonWasPushed(3);
        remoteControl.offButtonWasPushed(3);
        remoteControl.onButtonWasPushed(4);
        remoteControl.offButtonWasPushed(4);



    }
}
